---
title: Gridlines
---

Gridlines are visual elements in spreadsheets used to distinguish cells. They help users view and organize data more easily. Univer provides functionality to show and hide gridlines, as well as the ability to set the color of gridlines.

## Facade API

### Toggle Gridlines Visibility

```typescript
const fWorkSheet = univerAPI.getActiveWorkbook().getActiveSheet()

// Hide gridlines
fWorkSheet.setHiddenGridlines(true)

// Show gridlines
fWorkSheet.setHiddenGridlines(false)
```

### Get Current Gridlines Visibility Status

```typescript
const fWorkSheet = univerAPI.getActiveWorkbook().getActiveSheet()

// Check if gridlines are hidden
if (fWorkSheet.hasHiddenGridLines()) {
  console.log('Gridlines are hidden')
}
```

### Set Gridlines Color

```typescript
const fWorkSheet = univerAPI.getActiveWorkbook().getActiveSheet()

// Set gridlines color to red
fWorkSheet.setGridLinesColor('#ff0000')
console.log(fWorkSheet.getGridLinesColor()) // #ff0000
```
